package com.tledu.oop4;

public class OOP08 {
    public static void main(String[] args) {
        Person zhangsan = new Person();
        Cat cat = new Cat();
        cat.setName("小花");
        // 拥有一支猫
        zhangsan.setPet(cat);
        zhangsan.feedThePet();
        // 养别的宠物了
        Dog dog = new Dog();
        dog.setName("旺财");
        zhangsan.setPet(dog);
        zhangsan.feedThePet();
    }
}
